package ObserverPattern;

/**
 * @Author: zhaojie
 * @Date: Created in 17:23 2018/6/25
 * @Description:
 */
public class BinaryObserver  extends Observer{

    public BinaryObserver(Subject subject){
        this.subject=subject;
        this.subject.attach(this);
    }

    @Override
    public void update() {
        System.out.println( "Binary String: "
                + Integer.toBinaryString( subject.getState() ) );
    }
}
